package dao.common;

import models.exceptions.CreateEntityException;
import models.exceptions.DeleteEntityException;
import models.shop.Category;
import models.shop.CategoryAlias;
import models.shop.CategoryImageRecord;
import models.shop.Image;

import java.util.List;

public interface CategoryManager {
    List<Category> listByParentId(int parentId);

    void save(Category category) throws CreateEntityException;

    Category getById(int id);

    void delete(int id) throws DeleteEntityException;

    long count();

    void clearCache();

    Category create(String title, int parentId) throws CreateEntityException;

    Category createRoot(String title) throws CreateEntityException;

    List<Category> listByParentId(int id, boolean countProducts);

    List<Category> listByParentId(int id, int brandId);

    Category getForEdit(int id);

    void addAlias(CategoryAlias alias);

    void deleteAlias(int aliasId);

    void addImage(int categoryId, Image image);

    void deleteImage(int categoryId, int imageId);

    List<CategoryImageRecord> getCategoryImages();
}
